package com.org.javabody.continueapi;

public class ContinueDemo {

	public void show() {
		String[] str = {"1","2","3","4","5","6","7","8","9"};
		for(int i=0; i <str.length; i++) {
			if(str[i].equalsIgnoreCase("4")) {				 
				continue;
			}
			System.out.print(str[i]);
		}
	}
	
	public void print() {
		
		Integer[] inte = {1,2,3,4};
		int sum = 0;
		for(int i=0; i <inte.length; i++) {			
			if(i==4) { //i=4,直接跳过本循环，继续下一个循环			 

				continue;
			}	
			sum = sum+inte[i];
		}
		System.out.println(sum);
		
		
	}
	
    public static void main(String[] args) {
    	ContinueDemo cd = new ContinueDemo();
    	cd.print();
    	cd.show();
    }
}